const options = {
  method: 'POST',
  headers: {
    Authorization: 'Bearer sk-xjdlmjxiqybobfaykkxwibzslbuycrphhvcsckieutcqhfcz',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'Qwen/QwQ-32B',
    messages: [
      {
        role: 'user',
        content: 'What opportunities and challenges will the Chinese large model industry face in 2025?',
      },
    ],
    stream: false,
    max_tokens: 512,
    stop: null,
    temperature: 0.7,
    top_p: 0.7,
    top_k: 50,
    frequency_penalty: 0.5,
    n: 1,
    response_format: { type: 'text' },
    tools: [
      {
        type: 'function',
        function: { description: '<string>', name: '<string>', parameters: {}, strict: false },
      },
    ],
  }),
}

fetch('https://api.siliconflow.cn/v1/chat/completions', options)
  .then(response => response.json())
  .then(response => response)
  .then(res => {
    console.log('res', res)
    const content = res.choices[0].message.content
    console.log('content', content)
    return res.choices[0].message.content
  })
  .catch(err => console.error(err))
